package com.dnjn.happiness.emo.api;

import com.dnjn.happiness.common.core.constant.SecurityConstants;
import com.dnjn.happiness.common.core.constant.ServiceNameConstants;
import com.dnjn.happiness.common.core.domain.R;
import com.dnjn.happiness.emo.api.domain.UserModelScore;
import com.dnjn.happiness.emo.api.factory.RemoteUserModelScoreFactory;
import com.dnjn.happiness.common.core.score.dto.UserModelScoreVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

@FeignClient(contextId = "remoteUserModelScoreService",value = ServiceNameConstants.EMO_SERVICE,fallbackFactory = RemoteUserModelScoreFactory.class)
public interface RemoteUserModelScoreService {

    @GetMapping("/userModelScore/updateUserModel/{userId}")
    void updateUserModel(@PathVariable("userId") Long userId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/userModelScore/getUserModelScoreByUserIdAndType/{userId}/{rtype}")
    R<UserModelScore> getUserModelScoreByUserIdAndType(@PathVariable("userId") Long userId, @PathVariable("rtype") String rtype, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/userModelScore/getuserModelScoreList/{userId}")
    R<List<UserModelScore>> getuserModelScoreList(@PathVariable("userId") Long userId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PutMapping("/userModelScore/updateUserModelScoreList")
     void updateUserModelScoreList(@RequestBody UserModelScore item, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PutMapping("/userModelScore/updateUserModelScore")
    void updateUserModelScore(@RequestBody UserModelScoreVO vo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);


    @GetMapping("/userModelScore/getListByUserId/{userId}")
    R<List<UserModelScore>> getListByUserId(@PathVariable("userId") Long userId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);


}
